import { IUserLogin } from "@/types";
import http from "@/utils/request";

//登录接口
export const Login = (params: IUserLogin) => {
  return http.post(`/api/v1/auth/login?username=admin&password=123456`, params)
}

//验证码
export const Captcha = () => {
  return http.get("/api/v1/auth/captcha", {
    params: {
      height: 40,
      width: 150
    }
  })
}




//当前登录人信息
export const Person = () => {
  return http.get("/prod-api/api/v1/users/me")
}
// 获取菜单和权限
export const Permmenu = () => {
  return http.get("/api/v1/menus/routes")
}

// export const Permmenu = (params: { keywords?: string, status: string }) => {
//   return ({
//     URL: "/api/v1/menus",
//     method: 'get',
//     params: {
//       keywords,
//       status
//     }
//   })
// }



export const GetUserList = () => {
  return http.get("/api/v1/users/me")
}

//获取角色列表
// /api/admin/base/sys/role/page
export const getRoleList = () => {
  return http.get("/api/v1/roles/page")
}

//获取菜单列表
// /api/admin/base/sys/menu/list
export const getMenuList = () => {
  return http.get("/api/v1/menus")
}


//参数列表
// /api/admin/base/sys/param/page
// export const getConfigList = () => {
//   return http.post("/api/admin/base/sys/param/page")
// }